		<form class='form-horizontal' role='form' id='form1' method="POST">
			<input type="hidden" id="id" name="id" value="<?php echo $dados->id ;?>">
            <div class="modal-header btn-primary" >
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                 <h4 class="modal-title">Editar Atendimento</h4>

            </div>
            <div class="modal-body">
				<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">Ramal</label>
				<div class="col-sm-4">
				  <input type="text" class="form-control input-sm" id="ramal1" name="ramal1" placeholder="Ramal" value="<?php echo $dados->ramal ;?>">
				</div>
			  </div>
			  <div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">De</label>
				<div class="col-sm-10">
				  <input type="text" class="form-control input-sm" id="solicitante1" name="solicitante1" placeholder="De" value="<?php echo $dados->solicitante ;?>">
				</div>
			  </div>
			  <div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">Telefone</label>
				<div class="col-sm-4">
				  <input type="text" class="form-control input-sm" id="telefone1" name="telefone1" placeholder="Telefone" value="<?php echo $dados->telefone ;?>">
				</div>
			  </div>
			  <div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">Para</label>
				<div class="col-sm-10">
				  <input type="text" class="form-control input-sm" id="solicitado1" name="solicitado1" placeholder="Para" value="<?php echo $dados->solicitado ;?>">
				</div>
			  </div>
			  <div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">Assunto</label>
				<div class="col-sm-10">
				  <textarea class="form-control input-sm" id="assunto1" name="assunto1"  placeholder="Assunto"><?php echo $dados->assunto ;?></textarea>
				</div>
			  </div>
			  
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">Tipo</label>
				<div class="col-sm-5">
					<select name="tipoligacao1" id="tipoligacao1" class="form-control input-sm">
					<?php if($dados->tipoligacao == '1'){?>
						<option value="1" selected >LOCAL</option>
						<option value="2">INTERURBANO</option>
						<?php }else{?>
						<option value="1">LOCAL</option>
						<option value="2" selected>INTERURBANO</option>
						<?php }?>
					</select>
				</div>
			</div>
			<div id="retorno3"></div>					
			</div>
				<div class="modal-footer">
				<button type="submit" id="modalate" class="btn btn-primary">Editar</button>
					<a id="cancelar" href="<?php echo base_url('/index.php/inicio/atendimento');?>" class="btn btn-default"></span>Cancelar</a>
				
				</div>
		</form>

<script type="text/javascript">
    $(document).ready(function(){
		$("#ramal1").focus()
		//$("#ramal").mask('9999');
		var maskBehavior = function (val) {
			return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
		},
		options = {onKeyPress: function(val, e, field, options) {
				field.mask(maskBehavior.apply({}, arguments), options);
			}
		};
		$("#telefone1").mask(maskBehavior, options);
		
		$("#modalate").click(function(){

			$('#form1').validate({  
				rules: {  
					ramal1: { required: true },
					solicitante1: { required: true },
					telefone1: { required: true},
					solicitado1: { required: true }
					
				},  
				messages: {  
					ramal1: { required: 'Preencha o campo'},
					solicitante1: { required: 'Preencha o campo'},
					telefone1: { required: 'Preencha o telefone'},
					solicitado1: { required: 'Preencha o campo'}
				},
				submitHandler: function( form ){  
					var dados = $( form ).serialize();  

					$.ajax({  
						type: "POST",  
						url: "<?php echo base_url('index.php/inicio/editar');?>",  
						data: dados,  
						success: function( data )  
						{  
							$('#myassunto').modal('hide');
							window.location = "<?php echo base_url('index.php/inicio/atendimento');?>";
							
						}  
					});  
					return false;  
				} 
			}); 
		}); 
		
			

	
	});
	
	
</script>
</body>
</html>